

package com.example.administrator.caigou51.recyclerCard.cardView;

import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.administrator.caigou51.R;
import com.example.administrator.caigou51.activity.WebHtmlActivity;
import com.example.administrator.caigou51.global.App;
import com.example.administrator.caigou51.global.Constant;
import com.example.administrator.caigou51.recyclerCard.basic.CardItemView;
import com.example.administrator.caigou51.recyclerCard.card.DingDanTingXingCard;
import com.example.administrator.caigou51.util.ImageUtil;


public class DingDanTingXingCardView extends CardItemView<DingDanTingXingCard> {
 	private Context mContext;
    private TextView textView_date;
    private TextView textView_state;
    private ImageView imageViewGoods;
    private TextView textView_content;
    public DingDanTingXingCardView(Context context) {
        super(context);
        mContext=context;
        // TODO Auto-generated constructor stub
    }

    public DingDanTingXingCardView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mContext=context;
        // TODO Auto-generated constructor stub
    }

    public DingDanTingXingCardView(Context context,
                                    AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        mContext=context;
        // TODO Auto-generated constructor stub
    }
    @Override
    public void build(DingDanTingXingCard card) {
        // TODO Auto-generated method stub
        super.build(card);
        textView_date = (TextView) findViewById(R.id.textView_date);
        textView_state = (TextView) findViewById(R.id.textView_state);
        imageViewGoods = (ImageView) findViewById(R.id.imageViewGoods);
        textView_content = (TextView) findViewById(R.id.textView_content);

        textView_date.setText(card.getDataEntity().getSend_time());
        textView_state.setText(card.getDataEntity().getSubject());
        App.displayImageHttpOrFile(card.getDataEntity().getImage(),imageViewGoods, ImageUtil.OptionsActivity());
        textView_content.setText(card.getDataEntity().getContent());

        setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent =new Intent(mContext, WebHtmlActivity.class);
                intent.putExtra(WebHtmlActivity.Title,"物流详情");
                intent.putExtra(WebHtmlActivity.WebUrl, Constant.getHtml5UrlFotParameter(Constant.HTML5.Html5_check_order_state,"百世快递","70856203006293"));
                mContext.startActivity(intent);
            }
        });
    }
}
